package com.ls.hnks.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ls.hnks.model.TrainingAttachment;
import com.ls.hnks.service.TrainingAttachmentService;
import com.ls.hnks.mapper.TrainingAttachmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 15375
* @description 针对表【tb_training_attachment(用户培训附件)】的数据库操作Service实现
* @createDate 2023-01-25 21:58:30
*/
@Service
public class TrainingAttachmentServiceImpl extends ServiceImpl<TrainingAttachmentMapper, TrainingAttachment>
    implements TrainingAttachmentService{

    @Override
    public List<TrainingAttachment> getAttachMentByTrainId(String id) {
        QueryWrapper<TrainingAttachment> attachmentQueryWrapper = new QueryWrapper<>();
        attachmentQueryWrapper.eq("TrainingID",id);
        attachmentQueryWrapper.orderByDesc("CurrentTime");
        return this.list(attachmentQueryWrapper);
    }
}




